<script lang="ts" setup>
import useDrawVid, { useDrawVidRefs } from "../hooks/useDrawVid";
const { onLoad, onRefresh } = useDrawVid();
const { videoList, loading, finished, refreshing } = useDrawVidRefs();
</script>
<template>
  <div class="px-12 pt-21">
    <van-pull-refresh
      v-model="refreshing"
      @refresh="onRefresh"
      loosing-text="释放即可刷新..."
      loading-text="加载中..."
      pulling-text="下拉即可刷新..."
    >
      <van-list
        v-model:loading="loading"
        :finished="finished"
        @load="onLoad"
        :offset="300"
        finished-text="没有更多了"
        loading-text="加载中..."
      >
        <Player
          v-for="(item, index) in videoList"
          :key="index"
          :options="{
            youtubeId: item.youtubeId,
            className: 'rounded-[10px_10px_0_0]'
          }"
          class="mb-13"
        />
      </van-list>
    </van-pull-refresh>
  </div>
</template>
